﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ItemPerviewIcon : MonoBehaviour
{
    public Text ItemName;
    public Image ItemPerview;
    public Item Item
    {
        get { return m_Item; }
        set {
            m_Item = value;
            if (null == m_Item)
                return;

            ItemName.text = m_Item.Name;
            ItemPerview.sprite = Resources.Load<Sprite>(m_Item.Perview);
            ItemPerview.preserveAspect = true;
        }
    }
    public Item m_Item;

    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
